<style>
/*.stat{font-size:16px;padding:8px;}
.stat span{color:#FF5722; font-size:16px;font-weight:bold;}
#left,#b-right{width: 49%;float: left;}*/
</style>
<div id="table">
    <form class="layui-form layui-form-pane fixed-bar-form" action="" method="post" id="hisi-table-search1">
        <div class="layui-form-item">
            <div class="layui-inline removeStat">
				<label class="layui-form-label">出库时间</label>
				<div class="layui-input-inline">
					<input type="text" name="delivery_time" readonly="" id="delivery_time" lay-verify="" placeholder="选择下单日期" class="layui-input">
				</div>
			</div>
            <div class="layui-inline">
                <label class="layui-form-label">订单号</label>
                <div class="layui-input-inline">
                  <input type="text" id="client_ordernum" name="client_ordernum" lay-verify="" placeholder="输入订单号" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">物料名称</label>
                <div class="layui-input-inline">
                  <input type="text" id="name" name="name" lay-verify="" placeholder="输入物料名称" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">供应商名称</label>
                 <div class="layui-input-inline stall-select">
                     {:Form::select('stall_id','' , $stallsKV, 'stall-ids', 'layui-input','lay-search="" lay-verify="required"')}
                 </div>
            </div>
            <div class="layui-inline">
                <button type="submit" class="layui-btn" lay-submit="check" lay-filter="check">搜索</button>
            </div>
        </div>
    </form>
    <table id="leftData" lay-filter="leftData"></table>
</div>
<script type="text/javascript">
	layui.use([ 'jquery', 'util','table', 'laydate', 'form', 'laytpl','tool','layer' ], function() {
		var $ = layui.jquery;
		var table = layui.table,util = layui.util;
        var table = layui.table;
        var laydate = layui.laydate;
        var form = layui.form;
        var layer = layui.layer;
        laydate.render({
		    elem: '#delivery_time'
		    ,range: '~'
		    ,theme: 'molv'
		    ,mark: {'{:$today}':''}
	    	,change: function(value, date, endDate){
		    	$('#delivery_time').val(value);
            	$('#layui-laydate1').remove();//关闭面板
            }
		});
        form.on('submit(check)', function(data){
			//submitCheckcloth('save', '{:url("save")}', data.field);
            var formData="&client_ordernum="+data.field.client_ordernum+"&name="+data.field.name+"&delivery_time="+data.field.delivery_time+"&stall_id="+data.field.stall_id;
            tableData(formData);
			return false;
		});
        window.tableData=function(formData){
            table.render({
                elem: '#leftData'
                ,url: "{:url('deliveryLog')}?a=get"+formData //数据接口
                ,id: 'leftData'
                ,page: true //开启分页
                ,skin: 'row'
                ,even: true
                ,limit: 20
                ,limits: [20,50,100,150,200]
                ,text: {
                    none : '暂无相关数据'
                }
                ,toolbar: true
                ,defaultToolbar: ['filter', 'exports', 'print']
                ,cols: [[ //表头
                     {field:'delivery_time',title : '出库时间',templet:function(d){return layui.util.toDateString(d.delivery_time * 1000)}}
                    ,{field:'client_ordernum',title : '订单号',templet:function(d){return "<span class='copy-item'>"+d.client_ordernum+"</span>"},width:85}//
                    ,{field:'name',title : '材料名称',templet:function(d){return "<span class='copy-item'>"+d.mInfo.name+"</span>"}}
                    ,{field:'color',title : '颜色',templet:function(d){return d.mInfo.color}}
                    ,{field:'cloth_num',title : '布号'}
                    ,{field:'stall_name',title : '供应商'}
                    ,{field:'reason',title : '退货原因'}
                    ,{field:'type_num',title : '退货数'}
                    ,{field:'return_length',title : '退料米长'}
                ]]
                ,done:function(res){

                }
            });
            form.render('select');
        }
        tableData("");
	});
</script>